home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
pagede1a
/
main1.frm
< prev
next >
Wrap
Text File
|
1999-08-31
|
23KB
|
781 lines
VERSION 5.00
Begin VB.Form Form1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
ClientHeight = 10965
ClientLeft = 15
ClientTop = 15
ClientWidth = 9210
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 10965
ScaleWidth = 9210
Begin VB.PictureBox picHandle
Appearance = 0 'Flat
BackColor = &H8000000D&
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Index = 0
Left = 2520
ScaleHeight = 375
ScaleWidth = 375
TabIndex = 1
Top = 2640
Visible = 0 'False
Width = 375
End
Begin VB.Label Label3
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = " Html code "
Height = 255
Index = 0
Left = 3120
TabIndex = 3
ToolTipText = "Html code"
Top = 1440
Visible = 0 'False
Width = 960
End
Begin VB.Label Label2
BackColor = &H00000000&
Height = 30
Index = 0
Left = 1800
TabIndex = 2
ToolTipText = "Line"
Top = 480
Visible = 0 'False
Width = 3015
End
Begin VB.Shape Shape1
Height = 975
Index = 0
Left = 1560
Top = 960
Visible = 0 'False
Width = 1335
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 1455
Index = 0
Left = 360
Top = 1560
Visible = 0 'False
Width = 1335
End
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = "Add Text"
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 240
TabIndex = 0
ToolTipText = "Text"
Top = 240
Visible = 0 'False
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
Private Declare Function SetROP2 Lib "gdi32" (ByVal hdc As Long, ByVal nDrawMode As Long) As Long
Private Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
Private Const NULL_BRUSH = 5
Private Const PS_SOLID = 0
Private Const R2_NOT = 6
Enum ControlState
StateNothing = 0
StateDragging
StateSizing
End Enum
Private m_CurrCtl As Control
Private m_DragState As ControlState
Private m_DragHandle As Integer
Private m_DragRect As New CRect
Private m_DragPoint As POINTAPI
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub zoomup(vle As Integer)
On Error Resume Next
Dim i As Integer
Form1.Width = Form1.Width * vle
Form1.Height = Form1.Height * vle
Form1.ShowHandles False
For i = 0 To Form1.Controls.Count - 1
Form1.Controls(i).Left = Form1.Controls(i).Left * vle
Form1.Controls(i).Top = Form1.Controls(i).Top * vle
Form1.Controls(i).Width = Form1.Controls(i).Width * vle
Form1.Controls(i).Height = Form1.Controls(i).Height * vle
Form1.Controls(i).FontSize = Form1.Controls(i).FontSize * vle
Next i
zoo = zoo + 1
End Sub
Sub zoomdown(vle As Integer)
On Error Resume Next
Dim i As Integer
Form1.Width = Form1.Width / vle
Form1.Height = Form1.Height / vle
Form1.ShowHandles False
For i = 0 To Form1.Controls.Count - 1
Form1.Controls(i).Left = Form1.Controls(i).Left / vle
Form1.Controls(i).Top = Form1.Controls(i).Top / vle
Form1.Controls(i).Width = Form1.Controls(i).Width / vle
Form1.Controls(i).Height = Form1.Controls(i).Height / vle
Form1.Controls(i).FontSize = Form1.Controls(i).FontSize / vle
Next i
zoo = zoo - 1
End Sub
Sub ShowHandles(Optional bShowHandles As Boolean = True)
Dim i As Integer
Dim xFudge As Long, yFudge As Long
Dim nWidth As Long, nHeight As Long
If bShowHandles And Not m_CurrCtl Is Nothing Then
With m_DragRect
nWidth = (picHandle(0).Width \ 2)
nHeight = (picHandle(0).Height \ 2)
xFudge = (0.5 * Screen.TwipsPerPixelX)
yFudge = (0.5 * Screen.TwipsPerPixelY)
picHandle(0).Move (.Left - nWidth) + xFudge, (.Top - nHeight) + yFudge
picHandle(4).Move (.Left + .Width) - nWidth - xFudge, .Top + .Height - nHeight - yFudge
picHandle(1).Move .Left + (.Width / 2) - nWidth, .Top - nHeight + yFudge
picHandle(5).Move .Left + (.Width / 2) - nWidth, .Top + .Height - nHeight - yFudge
picHandle(2).Move .Left + .Width - nWidth - xFudge, .Top - nHeight + yFudge
picHandle(6).Move .Left - nWidth + xFudge, .Top + .Height - nHeight - yFudge
picHandle(3).Move .Left + .Width - nWidth - xFudge, .Top + (.Height / 2) - nHeight
picHandle(7).Move .Left - nWidth + xFudge, .Top + (.Height / 2) - nHeight
End With
End If
For i = 0 To 7
picHandle(i).Visible = bShowHandles
Next i
End Sub
Private Sub DrawDragRect()
Dim hPen As Long, hOldPen As Long
Dim hBrush As Long, hOldBrush As Long
Dim hScreenDC As Long, nDrawMode As Long
hScreenDC = GetDC(0)
hPen = CreatePen(PS_SOLID, 2, 0)
hOldPen = SelectObject(hScreenDC, hPen)
hBrush = GetStockObject(NULL_BRUSH)
hOldBrush = SelectObject(hScreenDC, hBrush)
nDrawMode = SetROP2(hScreenDC, R2_NOT